package com.xgimi.open.skill.datamanager.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.xgimi.commons.base.Result;
import com.xgimi.open.skill.datamanager.biz.service.SlotBizService;
import com.xgimi.open.skill.datamanager.service.api.SlotRpcService;
import com.xgimi.open.skill.datamanager.service.request.SlotReqDTO;
import com.xgimi.open.skill.datamanager.service.response.SlotPagequeryRespDTO;
import com.xgimi.open.skill.datamanager.service.response.SlotRespDTO;
import com.xgimi.open.skill.datamanager.service.response.page.PageResult;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author coderzpw.zhang
 * @version 1.0
 * @description 描述
 * @date 2023/3/3 14:25
 */
@Service
public class SlotRpcServiceImpl implements SlotRpcService {

    @Autowired
    private SlotBizService slotBizService;


    @Override
    public Result<Boolean> addSlot(SlotReqDTO slotReqDTO) {
        Boolean ret = slotBizService.addSlot(slotReqDTO);
        return new Result<>(ret);
    }

    @Override
    public Result<PageResult<SlotPagequeryRespDTO>> pageQuery(SlotReqDTO slotReqDTO) {
        PageResult<SlotPagequeryRespDTO> pageQuery = slotBizService.pageQuery(slotReqDTO);
        return new Result<>(pageQuery);
    }

    @Override
    public Result<Boolean> delete(SlotReqDTO slotReqDTO) {
        Boolean ret = slotBizService.deleteSlot(slotReqDTO);
        return new Result<>(ret);
    }

    @Override
    public Result<Boolean> update(SlotReqDTO slotReqDTO) {
        Boolean ret = slotBizService.updateSlot(slotReqDTO);
        return new Result<>(ret);
    }

    @Override
    public Result<List<SlotRespDTO>> listByIds(List<Long> ids) {
        List<SlotRespDTO> ret = slotBizService.listByIds(ids);
        return new Result<>(ret);
    }

    @Override
    public Result<List<SlotRespDTO>> listBySlotNames(List<String> slotNames, Long skillVid) {
        List<SlotRespDTO> ret = slotBizService.listBySlotNames(slotNames, skillVid);
        return new Result<>(ret);
    }

    @Override
    public Result<List<SlotRespDTO>> listBySkillVid(Long skillVid) {
        List<SlotRespDTO> ret = slotBizService.listBySkillVid(skillVid);
        return new Result<>(ret);
    }
}
